﻿using HCQ2_Model.ViewModel.WebAPI;
using HCQ2WebAPI_Logic.BaseAPIController;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using HCQ2_Model.VRDD.OutputDto._211217;
using HCQ2_Model.VRDD.InputDto._211217;
using HCQ2WebAPI_Logic.Model;
using HCQ2_Common.Constant;
using HCQ2_Model.VR;
using HCQ2_Common;
using HCQ2_Model;
using System.IO;
using System.Net.Http;
using HCQ2_Model.VRQDMeta.InputDto._20220112;
using HCQ2_Model.VRQDMeta.OutputDto._20220112;
using HCQ2_Model.ViewModel;
using HCQ2_Model.VRDD.InputDto._210908;
using HCQ2_Model.VRDD.InputDto._20220314;
using HCQ2_Model.APIBase;
using HCQ2_Model.VRDD.OutputDto._20220314;
using System.Globalization;
using HCQ2_Model.VRQDMeta.InputDto._20220418;
using System.Web;
using HCQ2_Model.VRQDMeta.OutputDto._20220418;
using HCQ2WebAPI_Logic.Filters;

namespace HCQ2WebAPI_Logic.DDController
{
    /// <summary>
    ///  规格相关api控制器
    /// </summary>
    public class VRDDSpecController : BaseWeiXinApiLogic
    {
        #region 1.0 ✔获取规格列表 + WebApiResultJsonModel GetDDSpecList(InputSaveHouse param)
        /// <summary>
        ///  1.0 ✔获取规格列表
        /// </summary>
        /// <param name="param">参数</param>
        /// <returns></returns>
        [HttpPost]
        [ModelValid]
        public WebApiResultJsonModel<List<OutputDDSpecList>> GetDDSpecList(InputDDSpecParam param)
        {
            var list = operateContext.bllSession.T_VRDDSpecMain.GetDDSpecList(param);
            return ApiResultJsonModel<List<OutputDDSpecList>>.RedirectWebApi(WebResultCode.Ok, string.Empty, list);
        }
        #endregion

        #region 1.1 ✔添加规格 + WebApiResultJsonModel AddDDSpec(InputVRSpecModel param)
        /// <summary>
        ///  1.1 ✔添加规格
        /// </summary>
        /// <param name="param">参数</param>
        /// <returns></returns>
        [HttpPost]
        [ModelValid]
        public WebApiResultJsonModel<int?> AddDDSpec(InputVRSpecModel param)
        {
            var user = operateContext.bllSession.T_User.FindSingle(s => s.user_guid.Equals(param.userid));
            if(user==null)
                ApiResultJsonModel<int?>.RedirectWebApi(WebResultCode.Ok, "用户编码信息异常！", null);
            return null;
        }
        #endregion
    }
} 